
@bg-color: #b7d4ab;
/* 清除默认样式 */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font: bold 20px "Courier";
}
// 设置控制器
#control {
  position: absolute;
  top: 50px;
  left: 100px;
  font-size: 18px;
  font-weight: 600;
}
/* 设置主窗口 */
#main {
  width: 360px;
  height: 420px;
  background-color: @bg-color;
  margin: 100px auto;
  border-radius: 10px;
  border: 10px solid #444;
  display: flex;
  flex-flow: column;
  justify-content: space-around;
  align-items: center;

  #stage {
    width: 304px;
    height: 304px;
    border: 2px solid black;
    position: relative;

    // 设置蛇的样式
    #snake {
      &>div {
        width: 10px;
        height: 10px;
        background-color: teal;
        border: 1px solid @bg-color;
        position: absolute;
      }
      &>div:first-child {
        width: 10px;
        height: 10px;
        background-color: rgb(124, 1, 58);
        border: 1px solid @bg-color;
        transform: rotate(45deg);
      }
    }
    // 食物样式
    &>#food {
      width: 10px;
      height: 10px;
      position: absolute;
      left: 40px;
      top: 80px;
      display: flex;
      flex-wrap: wrap;

      &>div {
        width: 5px;
        height: 5px;
        background-color: purple;
        border: 1px solid @bg-color;
        transform: rotate(45deg);
      }
    }
  }
  #score-panel {
    width: 100%;
    height: 25px;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
}